<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let a = 0
        // let num = +prompt('输入区间最小值')
        // let num1 = +prompt('输入区间最大值')
        function x(num,num1){
            for(num ; num <= num1 ; num++){
                a += num
            }
            alert(a)
        }
        x(+prompt('输入区间最小值'),+prompt('输入区间最大值'))
    </script>
</body>
</html>